import sys
import time
from multiprocessing import Process     

def piao(name,times):
    count = 0
    while (count < times):
        ncount = times - count
        # sys.stdout.write("\r%d " % ncount)
        #sys.stdout.flush()
        print('%s:%d' %(name,ncount))
        time.sleep(1)
        count += 1


p1=Process(target=piao,args=('e',50)) #必须加,号
p2=Process(target=piao,args=('a',100))           
p3=Process(target=piao,args=('w',30))           
p4=Process(target=piao,args=('y',150))           
p1.start()
p2.start()
p3.start()
p4.start()
print('主线程')
